{% if process.pk %}
{% with process.shipment as shipment %}
<div class="row">
    <div class="card">
        <div class="card-content">
            <div class="card-title black-text">Shipment #{{ shipment.shipment_no }}</div>
            {% if perms.shipment.change_shipment %}
                <a href="{% url 'admin:shipment_shipment_change' shipment.pk %}" class="card-edit no-pjax" target="_blank">(edit)</a>
            {% endif %}
            <table class="table">
                <thead>
                    <th>Item</th>
                    <th>Count</th>
                </thead>
                <tbody>
                    {% for item in shipment.shipmentitem_set.all %}
                    <tr>
                        <td> {{ item.name }} </td>
                        <td> {{ item.quantity }} </td>
                    </tr>
                    {% empty %}
                    <tr>
                        <td colspan="2">No items in shipment</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    <div class="card">
        <div class="card-content">
            <div class="card-title black-text">Address</div>
            {{ shipment.zipcode }}, {{ shipment.country }}, {{ shipment.city }}, {{ shipment.state }}<br/>
            {{ shipment.address }} <br/><br/>
            <strong>Phone:</strong> {{ shipment.phone }}
        </div>
    </div>
    {% if shipment.carrier or shipment.insurance %}
    <div class="card">
        <div class="card-content">
            <div class="card-title black-text">Delivery</div>
            {% if shipment.carrier %}
            <strong>Carrier:</strong> {{ shipment.carrier.name }}
            {% if perms.shipment.change_carrier %}
                <a href="{% url 'admin:shipment_carrier_change' shipment.carrier.pk %}" class="no-pjax" target="_blank">(edit)</a>
            {% endif %}
            <br/>
            {% endif %}
            {% if shipment.insurance %}
            <strong>Insurance:</strong> {{ shipment.insurance.company_name }} {{ shipment.insurance.cost}}
            {% if perms.shipment.change_insurance %}
                <a href="{% url 'admin:shipment_insurance_change' shipment.insurance.pk %}" class="no-pjax" target="_blank">(edit)</a>
            {% endif %}
            <br/>
            {% endif %}
        </div>
    </div>
    {% endif %}
</div>
{% endwith %}
{% endif %}
